using System;
using System.Collections.Generic;
using System.Text;

using ThatsMeSDK.Core;

namespace ThatsMeSDK
{
	public class MailBox
	{
        public MailBox(string _token)
        {
            token = _token;
        }

        private string token;

	    public MessageCount MailsCount
	    {
            get { return ServiceHandler.CountMessages(token); } 
	    }

        public bool SendMessage(string message, string receiver, string title)
        {
            return ServiceHandler.SendMessage(token, message, receiver, title);
        }
		
		/// <summary>
		/// Returns the newMessages 		0 = no new Messages			>= 1 are new Messages!
		/// </summary>
		/// <returns>
		/// A <see cref="System.Int32"/>
		/// </returns>
        public int CheckMessages()
        {
            int newMessages = ServiceHandler.CountMessages(token).Unread.Total- MailsCount.Unread.Total;
			return newMessages;
        }

	    public List<Message> UnReadMails { get; private set; }

        public List<Message> ReadMails { get; private set; }

        public List<Message> Alerts { get; private set; }
	}
}
